﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SEMS.Models;
using SEMS.DAL;

namespace SEMS.BLL
{
    public class ClassesBS
    {
        /// <summary>
        /// 获取所有班级列表
        /// </summary>
        /// <returns></returns>
        static public List<Classes> GetClassList()
        {
            using (var db = new SEMSDBContext())
            {
                return db.Classes.ToList();
            }
        }

        /// <summary>
        /// 获取所有大班号，不重复
        /// </summary>
        /// <returns></returns>
        static public List<string> GetClassIdList()
        {
            using (var db = new SEMSDBContext())
            {
                return db.Classes.Select(x => x.class_id).Distinct().ToList();    //Select是投影操作
            }
        }
    }
}